<!doctype html>
<link rel="stylesheet" href="resources/link-dragging-common.css" />
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>

<p>
  Please attempt to drag the "Drag Me" text out of the browser and release the drag.
</p>

<article>
  <a class="dragged box" id="target" draggable="true" href="https://www.chromium.org">
    Drag Me
  </a>
</article>

<script>
if (window.eventSender) {
  test(() => {
    const draggable_link = document.querySelector('#target');

    const clientRect = draggable_link.getBoundingClientRect();
    const centerX = (clientRect.left + clientRect.right) / 2;
    const centerY = (clientRect.top + clientRect.bottom) / 2;
    eventSender.mouseMoveTo(centerX, centerY);
    eventSender.mouseDown();
    eventSender.mouseMoveTo(centerX+200, centerY+200);
    eventSender.mouseLeave();
  }, 'The renderer should not crash');
}
</script>
